Page({
    data: {
      list: [
        {
          id: 0,
          title: '益生菌低脂奶粉',
          desc: '净含量:500克',
          price: 78.0,
          pic: 'https://ts2.tc.mm.bing.net/th/id/OIP-C.jDMYpp6_X3WXWVoOmKMpWQHaIz?rs=1&pid=ImgDetMain&o=7&rm=3'
        },
        {
          id: 1,
          title: '崇明岛稻米',
          desc: '超值套餐 · 买贵砍运营',
          price: 29.9,
          pic: 'https://img.alicdn.com/bao/uploaded/i3/2208334171994/O1CN01R6E3Xq1QbIXkaWEX3_!!0-item_pic.jpg'
        }
      ]
    },
  
    /* 事件处理 */
    detail(e) {
      const id = e.currentTarget.dataset.id;
      wx.showToast({ title: `查看详情 ${id}`, icon: 'none' });
    },
    review(e) {
      const id = e.currentTarget.dataset.id;
      wx.showToast({ title: `售后评价 ${id}`, icon: 'none' });
    },
    del(e) {
      const id = e.currentTarget.dataset.id;
      const newList = this.data.list.filter(item => item.id !== id);
      this.setData({ list: newList });
    }
  });